package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzDianpingMapper;
import com.ruoyi.system.domain.DzDianping;
import com.ruoyi.system.service.IDzDianpingService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 用户点评Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-16
 */
@Service
public class DzDianpingServiceImpl implements IDzDianpingService 
{
    @Autowired
    private DzDianpingMapper dzDianpingMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询用户点评
     * 
     * @param dpId 用户点评主键
     * @return 用户点评
     */
    @Override
    public DzDianping selectDzDianpingByDpId(Long dpId)
    {
        return dzDianpingMapper.selectDzDianpingByDpId(dpId);
    }

    /**
     * 查询用户点评列表
     * 
     * @param dzDianping 用户点评
     * @return 用户点评
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzDianping> selectDzDianpingList(DzDianping dzDianping)
    {

        //权限控制
        return dzDianpingMapper.selectDzDianpingList(dzDianping);
    }

    @Override
    public List<DzDianping> selectDzDianpingListWeb(DzDianping dzDianping)
    {
        return dzDianpingMapper.selectDzDianpingList(dzDianping);
    }

    /**
     * 新增用户点评
     * 
     * @param dzDianping 用户点评
     * @return 结果
     */
    @Override
    public int insertDzDianping(DzDianping dzDianping)
    {
        dzDianping.setCreateTime(DateUtils.getNowDate());
        return dzDianpingMapper.insertDzDianping(dzDianping);
    }

    /**
     * 修改用户点评
     * 
     * @param dzDianping 用户点评
     * @return 结果
     */
    @Override
    public int updateDzDianping(DzDianping dzDianping)
    {
        return dzDianpingMapper.updateDzDianping(dzDianping);
    }

    /**
     * 批量删除用户点评
     * 
     * @param dpIds 需要删除的用户点评主键
     * @return 结果
     */
    @Override
    public int deleteDzDianpingByDpIds(Long[] dpIds)
    {
        return dzDianpingMapper.deleteDzDianpingByDpIds(dpIds);
    }

    /**
     * 删除用户点评信息
     * 
     * @param dpId 用户点评主键
     * @return 结果
     */
    @Override
    public int deleteDzDianpingByDpId(Long dpId)
    {
        return dzDianpingMapper.deleteDzDianpingByDpId(dpId);
    }
}
